<template>
	<!-- <button class="_button" open-type="login" @login="login">微信登录</button> -->
	
	<button class="_button" open-type="getPhoneNumber" @getphonenumber="getphonenumber">授权手机号</button>
</template>

<script setup>
import  { wxlogin } from "@/utils/auth.js"
import { uniRouter } from "@/utils/index.js";

	async function login(){
		console.log("登录")
		let res = await wxlogin()
		console.log(res);
	}
	function getphonenumber(){
		console.log("获取电话")
		// uni.login({
		// 	success:(res)=>{
		// 		console.log(res);
		// 	}
		// })
		 uniRouter.relaunchTo("/pages/index/index")
	}
</script>

<style lang="scss">
	._button{
		width:80%;
		position: absolute;
		bottom:300rpx;
		left:50%;
		transform: translate(-50%,0);
		background-color: #fff;
		border-radius: 20rpx;
		border:1rpx solid #333;
	}
	._button::after{
		border:none;
		margin:0;
		padding:0;
		background-color: transparent;
	}
</style>